<template :pageProps="pageProps">
  <el-pagination class="pagination-vm"
    @size-change="handleSizeChange"
    @current-change="handleCurrentChange"
    :current-page="pageProps.currentPage"
    :page-sizes="pageProps.pageSizes"
    :page-size="pageProps.pageSize"
    :layout="pageProps.layout"
    :small="pageProps.small"
    :total="pageProps.total">
  </el-pagination>

</template>

<script>
export default {
  name: 'Pagination',
  props: {
    pageProps: {
      type: Object,
      default() {
        return {
          layout: 'total, sizes, prev, pager, next, jumper',
          currentPage: 1,
          pageSize: 10,
          pageSizes: [10],
          total: 0,
          small:false
        }
      }
    }
  },
  created () {
    this.pageProps.currentPage = 1
  },
  data() {
    return {}
  },
  methods: {
    handleSizeChange(val) {
      this.$emit('pageSizeChange', val)
    },
    handleCurrentChange(val) {
      this.$emit('pageCurrentChange', val)
    }
  }
}
</script>

<style lang='scss'>
.pagination-vm{
  margin-top:22px;
  // button:disabled {
  //   color: #ffffff;
  //   background-color: #409eff !important;
  //   margin: 0 5px;
  //   padding: 0;
  //   border-radius: 3px;
  // }
}
</style>